import React, { useContext } from 'react'

let Context = React.createContext()
let theme = {
  background: 'pink'
}

function App() {
  return (
    <Context.Provider value={theme}>
      <div>
        <Children></Children>
      </div>
    </Context.Provider>
  );
}

function Children() {
  let datas = useContext(Context)
  return (
    <div style={{ background: datas.background }}>
      Children
    </div>
  )
}
export default App;